home *** CD-ROM | disk | FTP | other *** search
/ Software USA 4 #8 / Software USA Volume 4.08.iso / mac / LifeStyles / ComicBase / ComicBase 3 Demo / ComicBase 3 Demo.rsrc / LENS_129_Import Price List < prev    next >
Encoding:
Text File  |  1999-08-16  |  13.0 KB  |  174 lines

  1. ItemType: WIND
  2. Rect: 287,248,737,520
  3. Style: Dialog
  4. HasTitleBar: TRUE
  5. HasZoomBox: FALSE
  6. Name: Import Price List
  7. IdleDelay: 30
  8. WhiteColor: -8739,-8739,-8739
  9. Script: --on windowEvent  wdID,wdName,objNo,objName,objValue¬Global gImportFields, gAvailableImportFields¬global gWindowPositions, gYears, gReplaceAllImportIssues¬global serialNum¬¬---------------------¬-- This is window #12¬---------------------¬¬if objValue="Open" then¬  -- Restore old window position¬  put OldWindowPosition(12) into windowRect¬  if windowRect = empty then centerWindow wdName¬  else wsSet wdID,"0","Rect",windowRect¬  ¬  wsSet wdID,"0","IdleDelay", "30"¬  ¬  if serialNum = empty then wsSet wdID,11,"Disabled","True"¬  else wsSet wdID,11,"Disabled","False"¬  ¬  -- Match up the actual years to the period fields¬  set the itemDelimiter to " " -- Option space¬  repeat with x = 1 to the number of lines of gYears¬    put line x of gYears into yearToMatch¬    ¬    put false into foundIt¬    repeat with listIndex = 1 to the number of lines of gImportFields¬      -- look in the importfields list¬      if item 1 of line listIndex of gImportFields = "Value-Year " & x then¬        delete item 2 of line listIndex of gImportFields¬        put " (" & yearToMatch & ")" after line listIndex of gImportFields¬        put true into foundIt¬      end if¬    end repeat¬    ¬    if not foundIt then¬      repeat with listIndex = 1 to the number of lines of gAvailableImportFields¬        if item 1 of line listIndex of gAvailableImportFields = "Value-Year " & x then¬          delete item 2 of line listIndex of gAvailableImportFields¬          put " (" & yearToMatch & ")" after line listIndex of gAvailableImportFields¬        end if¬      end repeat¬    end if¬  end repeat¬  ¬  ¬  wsSet wdID,"7","Name", "Move >>"¬  wsSet wdID,"ImportOrder","Text", gImportFields¬  wsSet wdID,"AvailableForImport","Text", gAvailableImportFields¬  if gAvailableImportFields ≠ empty then¬    wsSet wdID,"AvailableForImport","Selection", "1"¬    wsSet wdID,"7","Disabled", "False"¬  else¬    wsSet wdID,"AvailableForImport","Selection", "0"¬    wsSet wdID,"7","Disabled", "True"¬  end if¬  wsSet wdID,"LinesToSkip","Selection","0,99"¬  wsSet wdID,15,Hilite,gReplaceAllImportIssues¬  wsSet wdID,16,Hilite,(not gReplaceAllImportIssues)¬  ¬else if objValue="Close" then ¬  -- save the window position¬  put "12" & tab & wdName & tab & wsGet(wdID,"0","Rect") into line 12 of gWindowPositions¬  ¬else if objValue="Idle" then ¬  put wsGet("Import Price List",11,"Name") into theOldName¬  if the optionKey is down then¬    if theOldName <> "Import…" then ¬      wsSet "Import Price List","11","Name", "Import…"¬    end if¬  else ¬    if theOldName <> "Import" then¬      wsSet "Import Price List","11","Name", "Import"¬    end if¬  end if¬end if¬¬--end windowEvent¬
  10. Params: i3_SelectionText¬i5_SelectionText¬i9_Text
  11. Result: i3_TextOfSelection¬i5_TextOfSelection¬i9_Text¬i15_Hilite
  12.  
  13. ItemType: LIST
  14. Rect: 11,27,154,209
  15. TextFont: Geneva
  16. TextSize: 9
  17. Name: AvailableForImport
  18. Logic: Drag
  19. DoubleClickItem: 7
  20. Text: Comic Title¬Issue Number¬Quantity in Stock¬Condition¬Cost¬Cover Price¬Value-Year 1 (1993)¬Value-Year 2 (1994)¬Value-Year 3 (1996)¬Value-Year 4 (1997)¬Selling Price¬Notes¬Storylines¬Writer¬Artist
  21. Balloon: This is a list of all fields in the ComicBase which can be imported. Select a field here, then click “Move >>” to add it to the list which will be imported.
  22. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬get wsGet(wdID,"AvailableForImport","TextOfSelection")¬if it ≠ empty then¬  wsSet wdID,"7","Name", "Move >>"¬  wsSet wdID,"7","Disabled", "FALSE"¬else¬  wsSet wdID,"7","Disabled", "true"¬end if¬--end mouseUp
  23.  
  24. ItemType: LIST
  25. Rect: 296,27,442,209
  26. TextFont: Geneva
  27. TextSize: 9
  28. Name: ImportOrder
  29. Logic: Drag
  30. DoubleClickItem: 7
  31. Text: 
  32. Balloon: This is the list of fields which are to be imported. The order shown corresponds to the order which they will be expected in each record of your import file.
  33. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬get wsGet(wdID,"ImportOrder","SelectionText")¬if it ≠ empty then¬  if it ≠ "< Blank Field >" then¬    wsSet wdID,"7","Name", "<< Move"¬  else¬    wsSet wdID,"7","Name", "Remove"¬  end if¬  ¬  wsSet wdID,"7","Disabled", "False"¬end if¬¬--end mouseUp
  34.  
  35. ItemType: POP
  36. Rect: 101,219,174,232
  37. TextFont: Geneva
  38. TextSize: 9
  39. Name: ItemSeparator
  40. Text: Tab¬Space¬Return¬-¬Other…
  41. TitleItem: 4
  42. Balloon: This is the character which is used to separate different fields of a given issue. For most programs, “Tab” is used to separate fields.
  43. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬if objValue = "Other…" then¬  get windowScript("Other Separator")¬  if it <> empty then¬    put mapCharsToCharNames (NumToChar(line 2 of it)) into temp¬    wsSet "Import Price List","ItemSeparator","selectionText",temp¬  else¬    wsSet "Import Price List","ItemSeparator","SelectionText", "Tab"¬  end if¬end if¬--end mouseUp
  44.  
  45. ItemType: LBL
  46. Rect: 11,218,102,230
  47. TextFont: Geneva
  48. TextSize: 9
  49. TextStyle: Bold
  50. WhiteColor: -8739,-8739,-8739
  51. Text: Item Separator:
  52.  
  53. ItemType: POP
  54. Rect: 370,219,443,232
  55. TextFont: Geneva
  56. TextSize: 9
  57. Name: RecordSeparator
  58. Text: Tab¬Space¬Return¬-¬Other…
  59. TitleItem: 6
  60. Balloon: This is the character which is used to separate different records (issues) in the file you are importing. For most programs, a “Return” character is used to separate records.
  61. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬if objValue = "Other…" then¬  get windowScript("Other Separator")¬  if it <> empty then¬    put mapCharsToCharNames (NumToChar(line 2 of it)) into temp¬    wsSet "Import Price List","RecordSeparator","selectionText",temp¬  else¬    wsSet "Import Price List","RecordSeparator","SelectionText", "Return"¬  end if¬end if¬¬--end mouseUp
  62.  
  63. ItemType: LBL
  64. Rect: 266,219,370,231
  65. TextFont: Geneva
  66. TextSize: 9
  67. TextStyle: Bold
  68. WhiteColor: -8739,-8739,-8739
  69. Text: Record Separator:
  70.  
  71. ItemType: PUSH
  72. Rect: 173,31,277,51
  73. AutoSize: FALSE
  74. Name: Move >>
  75. DefaultItem: TRUE
  76. Balloon: If the name of this button is “Move >>”, clicking here will add the selected field to the list of fields which are to be imported. ¬¬If the name is “<< Move”, clicking here will remove the selected field from the list of fields to be imported.
  77. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬global serialNum¬¬if objName = "Move >>" then¬  put wsGet(wdID,"AvailableForImport","Text") into origListText¬  put wsGet(wdID,"AvailableForImport","Selection") into ImportSelectLine¬  put line importSelectLine of origListText into theSelectedItem¬  if theSelectedItem ≠ empty then¬    put wsGet(wdID,"ImportOrder","Text") into importList¬    delete line (ImportSelectLine) of origListText¬    wsSet wdID,"AvailableForImport","Text",origListText¬    ¬    if importList = empty then¬      wsSet wdID,"ImportOrder","Text", (theSelectedItem)¬    else¬      wsSet wdID,"ImportOrder","Text", (importList & return & theSelectedItem)¬    end if¬    ¬    if (line ImportSelectLine of origListText <> "")  then¬      wsSet wdID, "AvailableForImport","Selection",importSelectLine¬    else -- No selection left (at end of list, etc.)¬      if importSelectLine > 1  then¬        wsSet wdID, "AvailableForImport","Selection",importSelectLine - 1¬      else -- nothing left in list¬        wsSet wdID, 7,"Disabled",True¬      end if¬    end if¬    ¬    if serialNum <> empty then wsSet wdID,11,"Disabled", "False"¬  end if¬  ¬else -- Move back to original list¬  put wsGet(wdID,"ImportOrder","Selection") into theSelectedLine¬  put wsGet(wdID,"ImportOrder","Text") into importList¬  put line theSelectedLine of importList into theSelectedItem¬  ¬  if theSelectedItem ≠ empty then¬    put wsGet(wdID,"AvailableForImport","Text") into origListText¬    delete line (theSelectedLine) of importList¬    wsSet wdID,"ImportOrder","Text", importList¬    if theSelectedItem <> "< Blank Field >" then¬      put the number of lines of origListText into numAvailLines¬      if numAvailLines > 0 then¬        put return & theSelectedItem after origListText¬      else¬        put theSelectedItem after origListText ¬      end if¬      wsSet wdID,"AvailableForImport","Text",origListText¬    end if  ¬    ¬    if word 1 of line theSelectedLine of importList <> "" then¬      wsSet wdID, "ImportOrder","Selection",theSelectedLine¬    else¬      if theSelectedLine > 1 then ¬        wsSet wdID, "ImportOrder","Selection",theSelectedLine - 1¬      else -- nothing left in list¬        wsSet wdID, 7,"Disabled",True¬      end if¬    end if¬  end if¬  ¬  if importList = empty then¬    wsSet wdID,11,"Disabled", "True"¬  end if¬end if¬--end mouseUp¬
  78.  
  79. ItemType: LBL
  80. Rect: 266,239,417,251
  81. TextFont: Geneva
  82. TextSize: 9
  83. TextStyle: Bold
  84. WhiteColor: -8739,-8739,-8739
  85. Text: Lines to Skip at Beginning:
  86.  
  87. ItemType: TEXT
  88. Rect: 414,237,442,253
  89. TextFont: Geneva
  90. TextSize: 9
  91. Name: LinesToSkip
  92. LockText: FALSE
  93. Text: 0
  94. Balloon: Enter the number of lines which should be skipped over at the top of the import file before beginning the import. This is useful if there is heading information at the top of the file which is not part of the data.
  95.  
  96. ItemType: PUSH
  97. Rect: 173,188,277,208
  98. AutoSize: FALSE
  99. Name: Cancel
  100. CancelItem: TRUE
  101. AutoClose: TRUE
  102. Balloon: Click here to cancel without importing a file.
  103.  
  104. ItemType: PUSH
  105. Rect: 173,136,277,156
  106. AutoSize: FALSE
  107. Disabled: TRUE
  108. Name: Import
  109. Balloon: Click here to begin importing your file.
  110.  
  111. ItemType: PUSH
  112. Rect: 173,63,277,83
  113. Name: Add Blank >>
  114. Balloon: Click here to add a blank in between fields. This is useful if you are importing a file which contains fields (columns) which are not listed in the list of fields which can be imported. Then, these fields are simply skipped over.
  115. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬global serialNum¬¬put "< Blank Field >" into theSelectedItem¬put wsGet(wdID,"AvailableForImport","Selection") into importSelectedItem¬¬put wsGet(wdID,"ImportOrder","Text") into importList¬¬if importList = empty then  put (theSelectedItem) into importList¬else  put return & theSelectedItem after importList¬¬wsSet wdID,"ImportOrder","Text", (importList)¬get "AvailableForImport_Selection:" & importSelectedItem & return ¬if serialNum <> empty then put "i11_Disabled:False" & return after it¬wsSet wdName,"Properties",it¬--end mouseUp
  116.  
  117. ItemType: LBL
  118. Rect: 16,14,166,26
  119. TextFont: Geneva
  120. TextSize: 9
  121. TextStyle: Bold
  122. AutoSize: FALSE
  123. WhiteColor: -8739,-8739,-8739
  124. Text: Available Fields
  125.  
  126. ItemType: LBL
  127. Rect: 301,13,377,25
  128. TextFont: Geneva
  129. TextSize: 9
  130. TextStyle: Bold
  131. WhiteColor: -8739,-8739,-8739
  132. Text: Import Fields
  133.  
  134. ItemType: RAD
  135. Rect: 11,239,235,251
  136. TextFont: Geneva
  137. TextSize: 9
  138. WhiteColor: -8739,-8739,-8739
  139. Name: Replace all issues of imported titles (faster)
  140.  
  141. ItemType: RAD
  142. Rect: 11,254,199,266
  143. TextFont: Geneva
  144. TextSize: 9
  145. WhiteColor: -8739,-8739,-8739
  146. Name: Replace only matching or new issues
  147. Hilite: TRUE
  148.  
  149. ItemType: PUSH
  150. Rect: 173,162,277,182
  151. AutoSize: FALSE
  152. Name: Show Preview
  153. Balloon: Click here to begin importing your file.
  154. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬global importFileName, gImportWasDisabled, gMoveWasDisabled¬¬if objName = "Show Preview" then¬  put wsGet(wdID,"ImportOrder","Text") into gImportFields¬  ¬  put wsGet(wdID,"ItemSeparator","TextOfSelection") into itemDelimiterCharName¬  put wsGet(wdID,"RecordSeparator","TextOfSelection") into recDelimiterCharName¬  put wsGet(wdID,"LinesToSkip","Text") into skipLines¬  put mapCharNamestoChars(itemDelimiterCharName) into itemDelimiterChar¬  put mapCharNamestoChars(recDelimiterCharName) into recDelimiterChar¬  open file importFileName¬  repeat with x = 1 to skipLines¬    read from file importFileName until recDelimiterChar¬  end repeat¬  read from file importFileName until recDelimiterChar¬  close file importFileName¬  ¬  put xlate(it,itemDelimiterChar,return) into theList¬  ¬  -- put wsGet(wdID,"11","Disabled") into gImportWasDisabled¬  put wsGet(wdID,"7","Disabled") into gMoveWasDisabled¬  ¬  wsSet wdID,"AvailableForImport","Visible", "False"¬  wsSet wdID,"PreviewFields","Visible", "True"¬  wsSet wdID,"PreviewFields","Text", theList¬  wsSet wdID,objNo,"Name", "Hide Preview"¬  wsSet wdID,"13","Name", "Preview of 1st record"¬  -- wsSet wdID,"11","Disabled", true¬  wsSet wdID,"7","Disabled", true¬  ¬else¬  wsSet wdID,"AvailableForImport","Visible", "True"¬  wsSet wdID,"13","Name", "Available Fields"¬  wsSet wdID,"PreviewFields","Visible", "False"¬  wsSet wdID,objNo,"Name", "Show Preview"¬  -- wsSet wdID,"11","Disabled", gImportWasDisabled¬  wsSet wdID,"7","Disabled", gMoveWasDisabled¬end if¬¬--end mouseUp
  155.  
  156. ItemType: LIST
  157. Rect: 11,27,155,209
  158. TextFont: Geneva
  159. TextSize: 9
  160. Visible: FALSE
  161. Name: PreviewFields
  162. Logic: Drag
  163. DoubleClickItem: 7
  164. Text: 
  165. Balloon: This is a list of all fields in the ComicBase which can be imported. Select a field here, then click “Move >>” to add it to the list which will be imported.
  166. Script: --on mouseUp  wdID,wdName,objNo,objName,objValue¬get wsGet(wdID,"AvailableForImport","TextOfSelection")¬if it ≠ empty then¬  wsSet wdID,"7","Name", "Move >>"¬  wsSet wdID,"7","Disabled", "FALSE"¬else¬  wsSet wdID,"7","Disabled", "true"¬end if¬--end mouseUp
  167.  
  168. ItemType: LBL
  169. Rect: 161,120,289,132
  170. TextFont: Geneva
  171. TextSize: 9
  172. BlackColor: 13107,13107,-1
  173. WhiteColor: -4370,-4370,-4370
  174. Text: Demo Version: Can't Import